<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

    div{
        width: 200px;
        height: 100px;
        background-color: red;
    }
    .box{
        background-color: green;
        /* margin: 50px 50px; */
        padding: 50px  ;
        /* 固定盒子模型 */

        box-sizing: border-box;
    }
/* 通配符选择器 */

*{
    /* 计算盒子模型，防止撑开盒子   简写 bx*/
    box-sizing: border-box;
}

    </style>
</head>
<body>
    <div>1</div>
    <div class="box">2</div>
    <div>3</div>
</body>
</html>